<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="if (top.frames['componentsframe'] == undefined) { s = window.location.toString(); window.location = 'index.html?p=' + s.substring(s.lastIndexOf('/')+1); }">
<h2 class="comptitle">Simple Module <i>csma</i></h2>
<b>Package:</b> org.mixim.modules.mac<br/><b>File: <a href="src-modules-mac-csma.ned.html">src/modules/mac/csma.ned</a></b><br/><p><a href="../doxy/a00067.html" target="mainframe"><b>C++ definition</b></a></p>

<p>Generic CSMA protocol supporting Mac-ACKs as well as
constant, linear or exponential backoff times.</p>
<img src="org.mixim.modules.mac.csma-type.png" ismap="yes" usemap="#type-diagram"/><map name="type-diagram">
<area shape="rect" href="org.mixim.modules.mac.csma.html" title="csma" alt="csma" coords="0,30,74,70">
</map>
<h3 class="subtitle">Usage diagram:</h3>
<p>The following diagram shows usage relationships between types.
Unresolved types are missing from the diagram. Click <a href="full-ned-usage-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.mac.csma-usage.png" ismap="yes" usemap="#usage-diagram"/><map name="usage-diagram"><area shape="rect" href="org.mixim.modules.mac.csma.html" title="Simple Module csma" alt="csma" coords="7,16,79,40">
</map>
<h3 class="subtitle">Inheritance diagram:</h3>
<p>The following diagram shows inheritance relationships for this type.
Unresolved types are missing from the diagram. Click <a href="full-ned-inheritance-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.mac.csma-inheritance.png" ismap="yes" usemap="#inheritance-diagram"/><map name="inheritance-diagram"><area shape="rect" href="org.mixim.modules.mac.csma.html" title="Simple Module csma" alt="csma" coords="20,88,92,112">
<area shape="rect" href="org.mixim.modules.mac.CSMA802154.html" title="Simple Module CSMA802154" alt="CSMA802154" coords="11,160,101,184">
<area shape="rect" href="org.mixim.base.modules.BaseMacLayer.html" title="Simple Module BaseMacLayer" alt="BaseMacLayer" coords="7,16,105,40">
</map>
<h3 class="subtitle">Extends:</h3>
<table class="typestable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Type</th>
      <th class="description">Description</th>
   </tr>
<tr>
   <td>
<a href="org.mixim.base.modules.BaseMacLayer.html">BaseMacLayer</a>
   </td>
   <td>
<i>simple&nbsp;module</i>
   </td>
   <td>

<p>Base module for every mac layer module</p>

   </td>
</tr>
</table>
<h3 class="subtitle">Known subclasses:</h3>
<table class="typestable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Type</th>
      <th class="description">Description</th>
   </tr>
<tr>
   <td>
<a href="org.mixim.modules.mac.CSMA802154.html">CSMA802154</a>
   </td>
   <td>
<i>simple&nbsp;module</i>
   </td>
   <td>

<p>IEEE 802.15.4-2006 non-beacon enabled CSMA protocol
This model was independently validated on a wireless sensor network testbed.
For more information, see 
Accurate Timeliness Simulations for Real-Time Wireless Sensor Networks,
J. Rousselot, J.-D. Decotignie, M. Aoun, P. van der Stok, R. Serna Oliver,
G. Fohler. In Proceedings of the 2009 Third UKSim European Symposium on Computer 
Modeling and Simulation. </p>

   </td>
</tr>
</table>
<h3 class="subtitle">Parameters:</h3>
<table class="paramstable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Type</th>
      <th class="defaultvalue">Default value</th>
      <th class="description">Description</th>
   </tr>
<tr class="inherited">
   <td>notAffectedByHostState</td>
   <td>
      <i>bool</i>
   </td>
   <td>false</td>
   <td>
   </td>
</tr>
<tr class="inherited">
   <td>coreDebug</td>
   <td>
      <i>bool</i>
   </td>
   <td>false</td>
   <td>
<p>debug switch</p>
   </td>
</tr>
<tr class="inherited">
   <td>headerLength</td>
   <td>
      <i>int</i>
   </td>
   <td>72 bit</td>
   <td>
<p>length of the MAC packet header (in bits)</p>
   </td>
</tr>
<tr class="inherited">
   <td>address</td>
   <td>
      <i>string</i>
   </td>
   <td>"auto"</td>
   <td>
<p>MAC address as hex string (12 hex digits), or
"auto". "auto" values will be replaced by
a generated MAC address in init stage 1.</p>
   </td>
</tr>
<tr class="local">
   <td>debug</td>
   <td>
      <i>bool</i>
   </td>
   <td>false</td>
   <td>
<p>debug switch</p>
   </td>
</tr>
<tr class="local">
   <td>stats</td>
   <td>
      <i>bool</i>
   </td>
   <td>true</td>
   <td>   </td>
</tr>
<tr class="local">
   <td>trace</td>
   <td>
      <i>bool</i>
   </td>
   <td>false</td>
   <td>
   </td>
</tr>
<tr class="local">
   <td>queueLength</td>
   <td>
      <i>int</i>
   </td>
   <td>100</td>
   <td>
<p>size of the MAC queue (maximum number of packets in Tx buffer)</p>
   </td>
</tr>
<tr class="local">
   <td>bitrate</td>
   <td>
      <i>double</i>
   </td>
   <td>250000 bps</td>
   <td>
<p>bit rate</p>
   </td>
</tr>
<tr class="local">
   <td>ccaDetectionTime</td>
   <td>
      <i>double</i>
   </td>
   <td>0.000128 s</td>
   <td>
<p>Clear Channel Assessment detection time</p>
   </td>
</tr>
<tr class="local">
   <td>rxSetupTime</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>Time to setup radio to reception state</p>
   </td>
</tr>
<tr class="local">
   <td>aTurnaroundTime</td>
   <td>
      <i>double</i>
   </td>
   <td>0.000192 s</td>
   <td>
<p>Time to switch radio from Rx to Tx state</p>
   </td>
</tr>
<tr class="local">
   <td>txPower</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>tx power [mW]</p>
   </td>
</tr>
<tr class="local">
   <td>useMACAcks</td>
   <td>
      <i>bool</i>
   </td>
   <td></td>
   <td>
<p>Send/Expect MAC acks for unicast traffic?</p>
   </td>
</tr>
<tr class="local">
   <td>macMaxFrameRetries</td>
   <td>
      <i>int</i>
   </td>
   <td>3</td>
   <td>
<p>Maximum number of frame retransmission,
only used when usage of MAC acks is enabled.</p>
   </td>
</tr>
<tr class="local">
   <td>macAckWaitDuration</td>
   <td>
      <i>double</i>
   </td>
   <td>0.00056 s</td>
   <td>
<p>Time to wait for an acknowledgement after transmitting a unicast frame.
Only used when usage of MAC acks is enabled.
Value is calculated from 1+12+10+12 symbols, which is defined for nonbeacon-enabled PAN.
In the non-beacon-enabled case, the receiver responds at aTurnaroundTime 
(i.e. the time for the sender and receiver to both be guaranteed to have 
switched from Tx to Rx and vice verse).  This gives the value 192us + 
352us = 544us (there's been some discussion about the "extra" 1 symbol == 16us) 
[section 7.5.6.4.2 of the specification].</p>
   </td>
</tr>
<tr class="local">
   <td>ackLength</td>
   <td>
      <i>double</i>
   </td>
   <td>40 bit</td>
   <td>
<p>Complete MAC ack message length (in bits) 
(! headerLength is not added to this),
only used when usage of MAC acks is enabled.</p>
   </td>
</tr>
<tr class="local">
   <td>sifs</td>
   <td>
      <i>double</i>
   </td>
   <td>0.000192 s</td>
   <td>
<p>Simple interframe space (12 symbols). Time to wait between receiving a frame and acknowledging it.
Should be bigger than the maximum time for switching between Tx and Rx at the receiver.
Only used when usage of MAC acks is enabled.</p>
   </td>
</tr>
<tr class="local">
   <td>backoffMethod</td>
   <td>
      <i>string</i>
   </td>
   <td>"linear"</td>
   <td>
<p>Backoff method to use: constant, linear or exponential</p>
   </td>
</tr>
<tr class="local">
   <td>macMaxCSMABackoffs</td>
   <td>
      <i>int</i>
   </td>
   <td>5</td>
   <td>
<p>maximum backoffs</p>
   </td>
</tr>
<tr class="local">
   <td>aUnitBackoffPeriod</td>
   <td>
      <i>double</i>
   </td>
   <td>0.00032 s</td>
   <td>
<p>base unit for all backoff calculations</p>
   </td>
</tr>
<tr class="local">
   <td>contentionWindow</td>
   <td>
      <i>int</i>
   </td>
   <td>2</td>
   <td>
<p># of backoff periods of the initial contention window
(for linear and constant backoff method only)</p>
   </td>
</tr>
<tr class="local">
   <td>macMinBE</td>
   <td>
      <i>double</i>
   </td>
   <td>3</td>
   <td>
<p>minimum backoff exponent (for exponential backoff method only)</p>
   </td>
</tr>
<tr class="local">
   <td>macMaxBE</td>
   <td>
      <i>double</i>
   </td>
   <td>8</td>
   <td>
<p>maximum backoff exponent (for exponential backoff method only)</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Properties:</h3>
<table class="propertiestable">
   <tr>
      <th class="name">Name</th>
      <th class="value">Value</th>
      <th class="description">Description</th>
   </tr>
<tr>
   <td>class</td>
   <td><i>csma</i></td>
   <td></td>
</tr>
</table>
<h3 class="subtitle">Gates:</h3>
<table class="gatestable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Direction</th>
      <th class="gatesize">Size</th>
      <th class="description">Description</th>
   </tr>
<tr class="inherited">
   <td>upperLayerIn</xsl:if></td>
   <td><i>input</i></td>
   <td></td>   <td>
<p>from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td>upperLayerOut</xsl:if></td>
   <td><i>output</i></td>
   <td></td>   <td>
<p>to uppe layer</p>
</td>
</tr>
<tr class="inherited">
   <td>upperControlIn</xsl:if></td>
   <td><i>input</i></td>
   <td></td>   <td>
<p>control from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td>upperControlOut</xsl:if></td>
   <td><i>output</i></td>
   <td></td>   <td>
<p>control to upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td>lowerLayerIn</xsl:if></td>
   <td><i>input</i></td>
   <td></td>   <td>
<p>from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td>lowerLayerOut</xsl:if></td>
   <td><i>output</i></td>
   <td></td>   <td>
<p>to lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td>lowerControlIn</xsl:if></td>
   <td><i>input</i></td>
   <td></td>   <td>
<p>control from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td>lowerControlOut</xsl:if></td>
   <td><i>output</i></td>
   <td></td>   <td>
<p>control to lower layer</p>
</td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #808080; font-style: italic; ">//
// Generic CSMA protocol supporting Mac-ACKs as well as
// constant, linear or exponential backoff times.
//
</span><span style="color: #800000; font-weight: bold; ">simple</span><span style="color: #000000; "> </span><span style="color: #000000; ">csma</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">extends</span><span style="color: #000000; "> </span><span style="color: #000000; ">BaseMacLayer</span><span style="color: #000000; ">
{
    </span><span style="color: #800000; font-weight: bold; ">parameters</span><span style="color: #000000; ">:
        </span><span style="color: #000000; font-weight: bold; ">@class</span><span style="color: #000000; ">(</span><span style="color: #000000; ">csma</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// debug switch
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">debug</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">stats</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">true</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">trace</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">// length of MAC header
</span><span style="color: #000000; ">        </span><span style="color: #000000; ">headerLength</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">bit</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">72</span><span style="color: #000000; "> </span><span style="color: #000000; ">bit</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// size of the MAC queue (maximum number of packets in Tx buffer)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">queueLength</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">100</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// bit rate 
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">bitrate</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">bps</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">250000</span><span style="color: #000000; "> </span><span style="color: #000000; ">bps</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">// Clear Channel Assessment detection time
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">ccaDetectionTime</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">.</span><span style="color: #008000; ">000128</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// 8 symbols
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// Time to setup radio to reception state
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">rxSetupTime</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// Time to switch radio from Rx to Tx state
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">aTurnaroundTime</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">.</span><span style="color: #008000; ">000192</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);    </span><span style="color: #808080; font-style: italic; ">// 12 symbols
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">//tx power [mW]
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">txPower</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">mW</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">// Send/Expect MAC acks for unicast traffic?
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">useMACAcks</span><span style="color: #000000; ">;
        </span><span style="color: #808080; font-style: italic; ">// Maximum number of frame retransmission,
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// only used when usage of MAC acks is enabled.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">macMaxFrameRetries</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">3</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// Time to wait for an acknowledgement after transmitting a unicast frame.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// Only used when usage of MAC acks is enabled.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// Value is calculated from 1+12+10+12 symbols, which is defined for nonbeacon-enabled PAN.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// In the non-beacon-enabled case, the receiver responds at aTurnaroundTime 
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// (i.e. the time for the sender and receiver to both be guaranteed to have 
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// switched from Tx to Rx and vice verse).  This gives the value 192us + 
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// 352us = 544us (there's been some discussion about the &quot;extra&quot; 1 symbol == 16us) 
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// [section 7.5.6.4.2 of the specification].
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">macAckWaitDuration</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">.</span><span style="color: #008000; ">00056</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// Complete MAC ack message length (in bits) 
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// (! headerLength is not added to this),
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// only used when usage of MAC acks is enabled.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">ackLength</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">bit</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">40</span><span style="color: #000000; "> </span><span style="color: #000000; ">bit</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// Simple interframe space (12 symbols). Time to wait between receiving a frame and acknowledging it.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// Should be bigger than the maximum time for switching between Tx and Rx at the receiver.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// Only used when usage of MAC acks is enabled.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">sifs</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">.</span><span style="color: #008000; ">000192</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">//Backoff method to use: constant, linear or exponential
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">string</span><span style="color: #000000; "> </span><span style="color: #000000; ">backoffMethod</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">&quot;linear&quot;</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// maximum backoffs
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">macMaxCSMABackoffs</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">5</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// base unit for all backoff calculations
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">aUnitBackoffPeriod</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">.</span><span style="color: #008000; ">00032</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// # of backoff periods of the initial contention window
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// (for linear and constant backoff method only)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">contentionWindow</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">2</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// minimum backoff exponent (for exponential backoff method only)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">macMinBE</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">3</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// maximum backoff exponent (for exponential backoff method only)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">macMaxBE</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">8</span><span style="color: #000000; ">);

}

</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
